package com.dgut.fastdfs.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
 * @author ：陈文浩
 * @date ：Created in 2019/12/15 12:27
 * @description：
 */
/*@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString*/
public class MultipartFileParam implements Serializable {

    private static final long serialVersionUID = -5088917542299053255L;
    private String taskId;//文件传输任务ID
    private long chunkNumber;//当前为第几分片
    private long chunkSize;//每个分块的大小
    private long totalChunks;//分片总数
    private String identifier;//文件唯一标识
    private MultipartFile file;//分块文件传输对象

    public MultipartFileParam() {
    }

    public MultipartFileParam(String taskId, long chunkNumber, long chunkSize, long totalChunks, String identifier, MultipartFile file) {
        this.taskId = taskId;
        this.chunkNumber = chunkNumber;
        this.chunkSize = chunkSize;
        this.totalChunks = totalChunks;
        this.identifier = identifier;
        this.file = file;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public long getChunkNumber() {
        return chunkNumber;
    }

    public void setChunkNumber(long chunkNumber) {
        this.chunkNumber = chunkNumber;
    }

    public long getChunkSize() {
        return chunkSize;
    }

    public void setChunkSize(long chunkSize) {
        this.chunkSize = chunkSize;
    }

    public long getTotalChunks() {
        return totalChunks;
    }

    public void setTotalChunks(long totalChunks) {
        this.totalChunks = totalChunks;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public MultipartFile getFile() {
        return file;
    }

    public void setFile(MultipartFile file) {
        this.file = file;
    }

    @Override
    public String toString() {
        return "MultipartFileParam{" +
                "taskId='" + taskId + '\'' +
                ", chunkNumber=" + chunkNumber +
                ", chunkSize=" + chunkSize +
                ", totalChunks=" + totalChunks +
                ", identifier='" + identifier + '\'' +
                ", file=" + file +
                '}';
    }
}
